<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.gm.search.util.CommonUtils"%>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<%@ include file="/common/meta.jsp" %>
	<title>网站后台</title> 
	<meta content="index" name="activemenu" />
	<link href="${ctx}/css/login.css" type="text/css" rel="stylesheet"/> 
	<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
	<script src="${ctx}/js/highcharts.js" type="text/javascript"></script>
	<script type="text/javascript">
	$(function () {
    var chart;
    $(document).ready(function() {
        chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: ''
            },
            tooltip: {
        	    pointFormat: '{series.name}: <b>{point.percentage}%</b>',
            	percentageDecimals: 1
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
                        color: '#000000',
                        connectorColor: '#000000',
                        formatter: function() {
                            return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
                        }
                    }
                }
            },
            series: [{
                type: 'pie',
                name: '词分类分布',
                data: [
                    ['互联网',   30],
                    ['服装',     20],
                    {
                        name: '电器',
                        y: 10,
                        sliced: true,
                        selected: true
                    },
                    ['食品',    25],
                    ['其他',     15]
                ]
            }]
        });
        var highchart = {
                chart: {
                    renderTo: 'divstatus',
                    type: 'line'
                },
                title: {
                    text: ''
                },
                xAxis: {
                	categories: []
                },
                yAxis: {
                    title: {
                        text: '百分比(%) '
                    }
                },
                tooltip: {
                    enabled: true,
                    formatter: function() {
                        return '<b>'+ this.series.name +'</b><br/>'+
                            this.x +': '+ this.y+'%';
                    }
                },
                plotOptions: {
                    line: {
                        dataLabels: {
                            enabled: true,
                            formatter: function() {
                                return this.y +'%';
                            }
                        },
                        enableMouseTracking: true
                    }
                },
                series: []
            };
        for(var i=7;i--;i>0){
        	highchart.xAxis.categories.push(getDay(i));
        }
        highchart.series = new Array();
    	highchart.series[0] = new Object();
    	highchart.series[0].name="上线词";
    	highchart.series[0].data = new Array(10.5,20,40,55.5,60,75,90);
    	highchart.series[1] = new Object();
    	highchart.series[1].name="申请上线";
    	highchart.series[1].data = new Array(20,30,40,100,68,70,80);
    	highchart.series[2] = new Object();
    	highchart.series[2].name="准备上线";
    	highchart.series[2].data = new Array(10,20,30,43,50,60,80);

    	highchart.series[3] = new Object();
    	highchart.series[3].name="未处理";
    	highchart.series[3].data = new Array(10,1,22,1,11,60,70);

        var c = new Highcharts.Chart(highchart);
    });
   
});

	
	function getDay(d){
		var time="<%=CommonUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss")%>";
		var beforeDate =new Date(time.replace(/-/g, '/')); 
		beforeDate.setTime(beforeDate.getTime()-1000*60*60*24*d);
		var strYear2=beforeDate.getFullYear();
		var strMon2=beforeDate.getMonth()+1;
		var day=beforeDate.getDate();
		return day+"日";
	}
		</script>
</head>
<body>

<div id="wrapper">
	<%@ include file="/common/top.jsp"%>
	<div id="content">
		<%@ include file="/common/menu.jsp"%>
		<div class="index_left">
			<div class="mt">
				<h2>合作方信息</h2>
			</div>
			<div class="font13">林新祥；您好</div>
			<p class="clearb" ></p>
			<ul>
			  <li>所属合作伙伴</li>
			  <li>&nbsp;</li>
			  <li>会员角色：</li>
			  <li>合作方管理员</li>
			  <li>上次登录时间</li>
			  <li><s:date name="#session.logindate" format="yyyy-MM-dd HH:mm"/></li>
			  <li><a onclick="if (confirm('确定要退出吗？')) return true; else return false;" href="${ctx}/j_spring_security_logout" >退出系统</a></li>
			  <li><a href="user!input.action">修改密码</a> </li>
			</ul>
		</div>
		<div class="index_right">
			<div class="mt">
				<h2>词状态</h2>
			</div>
			<p class="clearb" ></p>
			<ul>
			  <li>管理总体量：</li>
			  <li>1</li>
			  <li>上线申请中：</li>
			  <li>0</li>
			  <li>处理中的词：</li>
			  <li>1(100%)</li>
			  <li>已下线：</li>
			  <li>0</li>
			  <li>未处理的词：</li>
			  <li>0(0%)</li>
			  <li>已冻结：</li>
			  <li>0</li>
			  <li>已上线词量：</li>
			  <li>1(100%)</li>
			  <li>上线被驳回：</li>
			  <li>0</li>
			</ul>
		</div>
		<p class="clearb" ></p>
		<div class="index_pie">
			<div class="mt">
				<h2>词分类分布</h2>
			</div>
			<div id="container" style="width:450px;height:225px;float:left;margin-top:15px;"></div>
		</div>
		<div class="index_area">
			<div class="mt">
				<h2>维护状态</h2>
			</div>
			<div id="divstatus" style="width:450px;height:240px;float:left;margin-top:15px;"></div>
		</div>
		
	</div>
	<%@ include file="/common/footer.jsp" %>
</div>
<!-- wrapper  end-->
</body>
</html>